#ifndef SPLIT_H
#define SPLIT_H

#include <string>
#include <vector>


using namespace std;



// characters part of command strings
char commandSeparator = '#';
char commandArgumentSeparator = '-';
char packageStopByte = '~';



vector<string> delimiterSplit(string splitString, char delimiter)
{
	string currentString;
	vector<string> splitted;
	
	// iterate over the string
	for(int i = 0; i < splitString.length(); i++)
	{
		const char currentChar = splitString.at(i);
		
		if(currentChar == delimiter)
		{
			splitted.push_back(currentString);
			currentString.erase();
		}
		else
		{
			currentString = currentString + currentChar;
			
			if(i == splitString.length() - 1) // last character
			{
				splitted.push_back(currentString);
			}
		}
	}
	
	return splitted;
}

#endif
